import echarts from 'echarts'
const install = function(Vue) {
	Object.defineProperties(Vue.prototype, {
		$chart: {
			get() {
				return {
					//画一条简单的线
					line1: function(id) {
						this.chart = echarts.init(document.getElementById(id));
						this.chart.clear();
						const optionData = {
							xAxis: {
								type: 'category',
								data: ['Week1', 'Week2', 'Week3', 'Week4', 'Week5']
							},
							yAxis: {
								type: 'value'
							},
							series: [{
								data: [2, 3, 3.5, 4.5, 5.5],
								type: 'line',
								smooth: true
							}]
						};
						this.chart.setOption(optionData);
					},
				}
			}
		}
	})
}

export default {
	install
}
